﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;

namespace PSE.Framework.UI.Controls.SmartClient
{ 
    //TODO: - DCM - Classe deverá ser alterada para ser abstrata
    //Essa alteração irá impactar no ExpanderContainer
    public abstract class GridSplitter : System.Windows.Controls.GridSplitter
    {
        public GridSplitter()
        {
            //this.DragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(GridSplitter_DragCompleted);
        }

        
        void GridSplitter_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
        {
            //int LinhaSplitter = Convert.ToInt32(this.GetValue(Grid.RowProperty));

            //ExpanderContainer grid = this.Parent as ExpanderContainer;

            //foreach (UIElement ui in grid.Children)
            //{
            //    Expander exp = ui as Expander;

            //    if (exp != null)
            //    {

            //        int LinhaExp = Convert.ToInt32(exp.GetValue(Grid.RowProperty));

            //        if (LinhaExp == (LinhaSplitter - 1))
            //        {
            //            if (grid.RowDefinitions[LinhaExp].Height.Value < exp.HeaderHeight)
            //                grid.RowDefinitions[LinhaExp].Height = new GridLength(exp.HeaderHeight);

            //            exp.startAnimation(true, grid.RowDefinitions[LinhaExp].Height.Value);

            //        }
            //    }
            //}
        }
    }
}

